server.port=9079

logging.level.sql=TRACE

# 分表
spring.shardingsphere.datasource.names=demo01
spring.shardingsphere.datasource.demo01.jdbc-url=jdbc:mysql://127.0.0.1:3306/demo?characterEncoding=UTF-8&useSSL=true
spring.shardingsphere.datasource.demo01.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.demo01.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.demo01.username=root
spring.shardingsphere.datasource.demo01.password=1

# 指定表名规则
spring.shardingsphere.sharding.tables.user.actual-data-nodes=demo01.user_$->{0..1}
spring.shardingsphere.sharding.tables.user.table-strategy.inline.sharding-column=id
spring.shardingsphere.sharding.tables.user.table-strategy.inline.algorithm-expression=user_$->{id % 2}
# 指定user表主键名以及主键生成策略SNOWFLAKE(雪花算法)
spring.shardingsphere.sharding.tables.user.key-generator.column=id
spring.shardingsphere.sharding.tables.user.key-generator.type=SNOWFLAKE
# 打印sql
spring.shardingsphere.props.sql.show=false
